﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using WfhTrader.Core.Trading;

namespace WfhTrader.Core.Trading
{
    /// <summary>
    /// CTP账户
    /// </summary>
    public sealed class CtpAccount : Account
    {
        public CtpAccount(CtpBroker ctpBroker, PurposeType purposeType, string accountNumber, string password, string remark)
        {
            this.Broker         = ctpBroker;
            this.PurposeType    = purposeType;
            this.AccountNumber  = accountNumber;
            this.Password       = password;
            this.Remark         = remark;
        }

        /// <summary>
        /// CTP交易接口
        /// </summary>
        private CtpTrade ctpTrade;

        /// <summary>
        /// 获取CTP交易接口
        /// </summary>
        /// <returns>CTP交易接口</returns>
        public override ITrade Trade
        {
            get
            {
                if (this.ctpTrade == null)
                    this.ctpTrade = new CtpTrade(this);

                return this.ctpTrade;
            }
        }
    }
}
